package com.garen.sys.biz.impl;

import com.garen.sys.dao.IFireRoleDao;
import com.garen.sys.entity.FireRole;
import com.garen.sys.biz.IFireRoleBiz;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import com.garen.common.*;


@Service
public class FireRoleBizImpl implements IFireRoleBiz {

	@Autowired
	private IFireRoleDao fireRoleDao;

	/*
	*分页查询
	*/
	@Override
	public List<FireRole> getFireRoleList(PageBean<FireRole> pb,FireRole fireRole){
		return fireRoleDao.getPageList(pb,fireRole);
	}

	/*
	*分页查询
	*/
	@Override
	public List<FireRole> getFireRoleList(FireRole fireRole){
		return fireRoleDao.getList(fireRole);
	}

	/*
	*查询个体
	*/
	@Override
	public FireRole getFireRole(FireRole fireRole){
		return fireRoleDao.get(fireRole);
	}

	/*
	*保存
	*/
	@Override
	public int saveFireRole(MsgBean mbean,FireRole fireRole){
		int ret = -1;
		if(fireRole.getRoleId() == null){
			ret = fireRoleDao.add(fireRole);
		}else{
			ret = fireRoleDao.update(fireRole);
		}
		return ret;
	}

	/*
	*删除
	*/
	@Override
	public int delFireRole(MsgBean mbean,FireRole fireRole){
		return fireRoleDao.del(fireRole);
	}

}
